home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
EnigmA Amiga Run 1997 July
/
EnigmA AMIGA RUN 20 (1997)(G.R. Edizioni)(IT)[!][issue 1997-07 & 08][EAR-CD IV].iso
/
programs
/
iconian
/
macros
/
add.icrx
next >
Wrap
Text File
|
1995-10-01
|
2KB
|
73 lines
/* An example REXX script for Iconian */
/* Pretty useless macro, really,
all it does is draw a 11x11 box around
the mouse cursor, adding 1 to the value
of each pixel. Is smart enough to wrap
the last color of the scree to color 0.*/
/* PS: Expect this script to take LOTS and LOTS of time! */
/* As this is expected to be run as a MACRO, Iconian will supply it's OWN address name! */
/* Otherwise, we'd need ADDRESS ICONIAN.1 */
/* Signal we wish to obtain results. */
options results
/* grab current mouse coords */
'getcoord x'
mx=result
'getcoord y'
my=result
/* Lock the GUI so the user can interfere! */
/* The FASTDRAW switch disables visual feedback during the locked phase.*/
lockgui FASTDRAW
/* Ask for the screen depth */
'getscreendepth'
depth=result
/* Now, convert that to the number of colors */
/* (Is there an easier way? Can rexx do a SHL? */
IF depth=1 THEN numofcolors=2
IF depth=2 THEN numofcolors=4
IF depth=3 THEN numofcolors=8
IF depth=4 THEN numofcolors=16
IF depth=5 THEN numofcolors=32
IF depth=6 THEN numofcolors=64
IF depth=7 THEN numofcolors=128
IF depth=8 THEN numofcolors=256
numofcolors=numofcolors-1
/* do a loop, -5 to +5 and -5 to +5 */
/* note that we don't simply plot each pixel.. we "drag" the mouse around */
'screentofront'
'plot'
Do t=my-5 to my+5
Do i=mx-5 to mx+5
getpixel i t
pen=result
pen=pen+1
If pen>=numofcolors Then pen=0
moveto i t
setfgcolor pen
IF mousedown=0 THEN
mousedown=1
leftmouse down
ENDIF
moveto i t
END
END
leftmouse up
/* Let go of the GUI. */
unlockgui